package com.ruoyi.web.controller.api.shop;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.domain.bo.PCategoryBo;
import com.ruoyi.system.domain.vo.PCategoryVo;
import com.ruoyi.system.service.IPCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 分类Controller
 *
 * @author ruoyi
 * @date 2022-08-02
 */
@Api(tags = {"前端-分类管理"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/category")
public class PCategoryApiController extends BaseController {

    private final IPCategoryService iPCategoryService;

    /**
     * 查询分类列表
     */
    @ApiOperation("查询分类列表")
    @GetMapping("/select-list")
    public R<List<PCategoryVo>> selectList(PCategoryBo bo) {
        List<PCategoryVo> list = iPCategoryService.queryMyList(bo);
        return R.ok(list);
    }

    @ApiOperation("会员中心查询")
    @GetMapping("/vipList")
    public R<Map<String, Object>> vipList() {
        return R.ok(this.iPCategoryService.vipList());
    }
}
